//https://leetcode.cn/problems/pascals-triangle/description/

class Solution {
public:
    vector<vector<int>> generate(int numRows) {
        vector<vector<int>> vv(numRows);
        for (size_t i = 0; i < numRows; i++)
        {
            //每一行都初始化为1
            vv[i].resize(i + 1, 1);

        }

        for (size_t i = 2; i < numRows; i++)
        {
            for (size_t j = 1; j < vv[i].size() - 1; j++)
            {
                vv[i][j] = vv[i - 1][j - 1] + vv[i - 1][j];
            }
        }

        return vv;

    }
};